// Source : https://leetcode.com/problems/single-number/
// Author : simba
// Date   : 2016-06-07

package main

import (
	"fmt"
)

func singleNumber(nums []int) int {
	single := 0

	for _, n := range nums {
		single ^= n
	}
	return single
}

func main() {
	//固定测试用例,正确答案2
	s1 := []int{3, 3, 2, 4, 4}
	a1 := singleNumber(s1)
	fmt.Println("数组", s1)
	fmt.Println("输出答案", a1)
	fmt.Println("正确答案2")
}
